Skip to content

ENH: Add support to find Headers in Apple Frameworks #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hjmjohnson
Copy link

The header locations in apple frameworks require manipulation of the directory name in a '<pkg/myhdr.h>' include defintion.

The header file is located at <pkg.framework/Headers/myhdr.h> in a framework.

hjmjohnson added a commit to hjmjohnson/PythonQt that referenced this pull request Jun 27, 2025
Add specific framework path handling

Refactor include directory parsing to support multiple candidate paths
for headers and introduce macOS-specific logic for resolving
framework-relative header paths. Enhance generator flexibility and
robustness for cross-platform usage.

Push upstream fix via:
danmar/simplecpp#448
@danmar
Copy link
Owner

danmar commented Jun 28, 2025

Thanks for your contribution.

  • An issue would be nice.
  • And some test.
  • We haven't switched to C++11 yet so that this simplecpp library will be as portable as possible. However I think we can start supporting C++11. I think C++11 should be widely supported by now. :-)

@hjmjohnson
Copy link
Author

It might be a few weeks before I circle back to push changes upstream.

@danmar
Copy link
Owner

danmar commented Jul 2, 2025

It might be a few weeks before I circle back to push changes upstream.

ok thanks understood.. for your information we have a PR to start using C++11 so if you get back in few weeks I will hopefully not complain about you using C++11 at least.

hjmjohnson added a commit to hjmjohnson/PythonQt that referenced this pull request Jul 16, 2025
Add specific framework path handling

Refactor include directory parsing to support multiple candidate paths
for headers and introduce macOS-specific logic for resolving
framework-relative header paths. Enhance generator flexibility and
robustness for cross-platform usage.

Push upstream fix via:
danmar/simplecpp#448
hjmjohnson added a commit to hjmjohnson/PythonQt that referenced this pull request Jul 16, 2025
Add specific framework path handling

Refactor include directory parsing to support multiple candidate paths
for headers and introduce macOS-specific logic for resolving
framework-relative header paths. Enhance generator flexibility and
robustness for cross-platform usage.

Push upstream fix via:
danmar/simplecpp#448
hjmjohnson added a commit to hjmjohnson/PythonQt that referenced this pull request Jul 16, 2025
Add specific framework path handling

Refactor include directory parsing to support multiple candidate paths
for headers and introduce macOS-specific logic for resolving
framework-relative header paths. Enhance generator flexibility and
robustness for cross-platform usage.

Push upstream fix via:
danmar/simplecpp#448
The header locations in apple frameworks require manipulation
of the directory name in a '<pkg/myhdr.h>' include defintion.

The header file is located at <pkg.framework/Headers/myhdr.h>
in a framework.
This is an outline of a test. The test currently fails.  I could not figure out how these tests are working.

I would greatly appreciate a little help to understand how to use the test framework.
@hjmjohnson hjmjohnson force-pushed the enh-add-apple-framework-header-support branch from 31bffbf to de9d233 Compare July 16, 2025 21:40
@hjmjohnson
Copy link
Author

@danmar I have updated this PR, but I am struggling to figure out how to make a test to exercise this code. I tried to decipher how other tests were working, but could not identify how the "cache" would need to be setup to test the new functionality. Any guidance would be greatly appreciated.

Thanks,
Hans

@hjmjohnson
Copy link
Author

@glankk Thank you for the C++11 updates! This is great work!

This PR is adjacent to some code that you recently refactored. It would be great to have your input.

Thanks,
Hans

@glankk
Copy link
Contributor

glankk commented Jul 17, 2025

I suggest we emulate gcc's darwin-specific -F option, and possibly -iframework as well. See https://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html. The -F paths are interleaved with -I and searched left-to-right, so the order of interleaved normal include paths and frameworks should be preserved. For this we could change the DUI::includePaths from being a vector of path strings to being a vector of structs with a path string and, on darwin, a framework flag that determines what search rules to use.

@danmar
Copy link
Owner

danmar commented Jul 20, 2025

I will go on vacation for a week. Please ping me later if you want review..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants